#ifndef __PCPT_COMM_CAR_H__
#define __PCPT_COMM_CAR_H__

#include "comm/comm_base.h"
#include "comm/comm_car.h"
#include "comm/comm_cfg_param.h"

using namespace std;

/**************************************************************************************
功能描述: 动态车辆执行器
修改记录:
**************************************************************************************/
class DYNC_CAR_EX_C : public DYNC_CAR_C
{
public:
    DYNC_CAR_EX_C() : DYNC_CAR_C()
    {
        if (0 != Init())
        {
           return;
        }
    }
    
    ~DYNC_CAR_EX_C(){}
    
    BOOL IsPointBehindHead(const COORDINATE_2D_STRU &stPoint) const;
    BOOL IsPointBehindBackAxis(const COORDINATE_2D_STRU &stPoint) const;
    BOOL IsPointInLeftSide(const COORDINATE_2D_STRU &stPoint) const;
    BOOL IsPointInGoBackDangerArea(const COORDINATE_2D_STRU &stObstPosByCar) const;

    void GetScanPointPosByLaser(unsigned int angleIdx, float dist, COORDINATE_2D_STRU &stPosByCar) const;
    void GetForwardScanPointPosByCar(unsigned int angleIdx, float dist, COORDINATE_2D_STRU &stPosByCar) const;
    void GetBackwardScanPointPosByCar(unsigned int angleIdx, float dist, COORDINATE_2D_STRU &stPosByCar) const;
    void GetForwardScanPointPosByMap(unsigned int angleIdx, float dist, COORDINATE_2D_STRU &stPosByMap) const;
    void GetBackwardScanPointPosByMap(unsigned int angleIdx, float dist, COORDINATE_2D_STRU &stPosByMap) const;
    
public:
    COOR_TF_C           objCarToScanTf_;
    COOR_TF_C           objCarToBackScanTf_;
    LASER_C             objGeneralLaser_;

protected:
    CFG_PARAM_C         objCfgParam_;

private:   
    DIRECTED_LINE_C     objHeadRightwardLine_;
    DIRECTED_LINE_C     objBackCameraRightwardLine_;
    DIRECTED_LINE_C     objBackAxisRightwardLine_;
    DIRECTED_LINE_C     objBodyCenterForwardLine_;

    COOR_2D_POSE_STRU   stBackCameraPoseByCar_;
    
    INT32 Init();
    void  InitDirectedLine();
    void  GetBackCameraPoseByCar(COOR_2D_POSE_STRU &stCameraPoseByCar);
};

#endif